<template>
  <el-drawer append-to="body" title="套餐列表" size="30%" v-model="visible" :before-close="close">
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="name" label="套餐" width="180" />
      <el-table-column prop="originalPrice" label="原价" width="180" />
      <el-table-column prop="discountedPrice" label="折扣价" />
    </el-table>
  </el-drawer>
</template>

<script setup lang="ts">
import { ProductApi } from '@/api/product/addProduct'

const props = defineProps(['productId'])
// const productId = ref(props.productId)
const visible = ref(false)
const tableData = ref([])
const show = (id) => {
  visible.value = true
  getList(id)
}
const close = () => {
  visible.value = false
}
const getList = (id) => {
  tableData.value = []
  ProductApi.getThaliPage(id).then((res) => {
    tableData.value = res.list
  })
}
onMounted(() => {
  // getList()
})
defineExpose({
  show,
  close
})
</script>

<style scoped></style>
